package com.xin.data.simbapesa.dialog;

import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.xin.data.simbapesa.R;
import com.xin.data.simbapesa.base.BaseDialog;
import com.xin.data.simbapesa.databinding.SimbaLoadingDialogBinding;


public class LoadingDialog extends BaseDialog<SimbaLoadingDialogBinding> {


    public LoadingDialog(@NonNull Context context) {
        super(context);
    }

    public LoadingDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected LoadingDialog(@NonNull Context context, boolean cancelable, @Nullable DialogInterface.OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected SimbaLoadingDialogBinding initViewBinding(LayoutInflater inflater) {
        return SimbaLoadingDialogBinding.inflate(inflater);
    }

    @Override
    protected void initView() {
        Glide.with(getContext())
                .asGif()
                .load(R.mipmap.loading)
                .into(binding.bar);
    }

    public void setTitle(String txt) {
        binding.tvTitle.setText(txt);
    }


}
